class Solution {
public:
    string largestNumber(vector<int>& nums) {
        string ret;

        vector<string> strs;
        for (auto& i : nums)
            strs.push_back(to_string(i));

        sort(strs.begin(), strs.end(), [](string s_a, string s_b){
            return s_a + s_b > s_b + s_a;
        });

        if (strs[0] == "0")
            return "0";

        for (auto i : strs)
            ret += i;

        return ret;
    }
};